DATA SEGMENT
    MAX_LENGTH DB 12
    REAL_LENGTH DB 0
    SPACE DB 12 DUP(?)
    PILF DB 0AH,0DH,'$'
DATA ENDS
CODE SEGMENT
    ASSUME CS:CODE,DS:DATA
START:
    MOV AX,DATA
    MOV DS,AX
    LEA DX,MAX_LENGTH
    MOV AH,0AH
    INT 21H
    MOV BL,REAL_LENGTH
    MOV BH,0
    MOV SPACE[BX],'$'
    LEA DX,PILF
    MOV AH,09H
    INT 21H
    LEA DX,SPACE
    MOV AH,09H
    INT 21H
    MOV AH,4CH
    INT 21H
CODE ENDS
END START